#include "Render.h"
#include <iostream>

bool GLAssert(const char * funcName, const char * fileName, int line)
{
	{
		GLenum error = glGetError();
		if (error != GL_NO_ERROR) {
			std::cout << "[OPENGL ERROR]: " <<
				fileName << ", " << line << ", " << funcName << "; " <<
				"ERROR TYPE: " << error << std::endl;

			//还是这个优雅一点 😓
			//__debugbreak();
			//assert(error == GL_NO_ERROR, "[OPENGL ERROR]: "
			//	__FILE__ ", " __LINE__ ", %s; " "ERROR TYPE: %d", funcName, error);

			return true;
		}

		return false;
	}
}
